package com.yunxin.core.utils.infra.support.desenditized.annotation;

import cn.hutool.core.util.DesensitizedUtil;
import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.yunxin.core.utils.infra.support.desenditized.DesensitizedFilter;

import java.lang.annotation.*;

/**
 * @author zero°
 * @since 2023-07-19
 */
@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@JacksonAnnotationsInside
@JsonSerialize(using = DesensitizedFilter.class)
public @interface DesensitizationField {

    /**
     * 脱敏方式<br>
     *
     * <p>默认按名称脱敏
     */
    DesensitizedUtil.DesensitizedType type() default DesensitizedUtil.DesensitizedType.CHINESE_NAME;
}
